package com.asset.dispoal.configurationBatch.service;

import com.asset.dispoal.configurationBatch.api.ConfigurationBatchService;
import com.asset.dispoal.configurationBatch.dto.ConfigurationBatchRequest;
import com.asset.dispoal.configurationBatch.service.commom.ConfigurationBatchInsertCommand;
import com.asset.dispoal.configurationBatch.service.commom.ConfigurationBatchQueryAllCommand;
import com.asset.dispoal.configurationBatch.service.commom.ConfigurationBatchQueryCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tech.mhuang.pacebox.springboot.protocol.Result;

/**
 * @author qr
 * @date 2022/3/25$
 */
@Component
public class ConfigurationBatchServiceImpl implements ConfigurationBatchService {

    @Autowired
    ConfigurationBatchQueryCommand configurationBatchQueryCommand;

    @Autowired
    ConfigurationBatchQueryAllCommand configurationBatchQueryAllCommand;

    @Autowired
    ConfigurationBatchInsertCommand configurationBatchInsertCommand;


    @Override
    public Result insert(ConfigurationBatchRequest request) {
        return configurationBatchInsertCommand.execute(request);

    }

    @Override
    public Result update(ConfigurationBatchRequest request) {
        return null;
    }

    @Override
    public Result query(String assetInstBatchId) {
        return configurationBatchQueryCommand.execute(assetInstBatchId);

    }

    @Override
    public Result queryById(String assetInstBatchId) {
        return configurationBatchQueryAllCommand.execute(assetInstBatchId);
    }
}
